package com.example.demo0

import com.example.util.p

interface MacBook{
    fun getCost():Int
    fun getDesc():String
    fun getProdDate():String
}

class MacBookPro:MacBook{
    override fun getCost() = 10000
    override fun getDesc() = "Macbook Pro"
    override fun getProdDate() = "Late 2011"
}



class ProcessorUpgradeMacbookPro(private val macBook: MacBook):MacBook by macBook{
    override fun getCost() = macBook.getCost() + 219

    override fun getDesc() = macBook.getDesc() + ", +1G Memory"

}



fun main(){
    val macbookPro = MacBookPro()
    val processorUpgradeMacbookPro = ProcessorUpgradeMacbookPro(macbookPro)

    p(processorUpgradeMacbookPro.getCost())
    p(processorUpgradeMacbookPro.getDesc())


}






